package ch08;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicCounter {

	private AtomicInteger value = new AtomicInteger();
	
	public int getValue(){
		return this.value.get();
	}
	
	public int increment(){
		return value.incrementAndGet();
	}
	
	public int increment(int i){
		return value.addAndGet(i);
	}
	
	public int decrment(){
		return value.decrementAndGet();
	}
	
	public int decrment(int i){
		return value.addAndGet(-i);
	}
	
}
